import { Store, Session } from '../../types';
import * as types from '../action-types';

let initState: Session = {
    user: { username: null, password: null, id: null },
    success: null,
    error: null
}

export default function (state: Session = initState, action): Session {
    switch (action.type) {
        case types.LOGIN:
            return action.playload
    }
    return state
}